package com.wx.javacode.poly_.detail_;

/**
 * ClassName:PolyDetail03
 * Package :com.wx.javacode.poly_.detail_
 * Description :
 *
 * @Author : coder_mu
 * @Create : 2023/5/18 - 20:15
 */
public class PolyDetail03 {
    public static void main(String[] args) {
        int i = 5;
        BB bb = new BB();
        System.out.println(bb instanceof AA);//true
        System.out.println(bb instanceof BB);//true
        AA aa = new AA();
        System.out.println(aa instanceof BB); //false  aa不是BB的类型，BB是AA子类
        System.out.println(aa instanceof AA);//true
        Object object = new Object();
        System.out.println(object instanceof AA);//false //Object是AA的父类
    }
}

class AA {
}

class BB extends AA {
}